# -*- coding:utf-8 -*-
# @FileName  :ent_archivequery.py
# @Time      :2020/12/21 15:49
# @Author    :Zhoujirong
# @Desc      :
from common.http_request import Request
from biz.support.urls import ServerUrl

class EntArchiveQueryRequst:
    '''授权信息查看页面'''
    @classmethod
    def get_page(cls,curPage,
            maxSize,
            search_EQ_enterpriseName,
            search_EQ_signCode,
            search_EQ_uniformSocialCredCode,
            search_EQ_orgInstCode,
            search_EQ_archiveType,
            search_EQ_creator,
            search_IN_ownorg,
            search_GTE_startDate_DATE,
            search_LTE_expireDate_DATE,cookie):
        '''检索'''
        params = {
            'curPage':curPage,
            'maxSize':maxSize,
            'search_EQ_enterpriseName':search_EQ_enterpriseName,
            'search_EQ_signCode':search_EQ_signCode,
            'search_EQ_uniformSocialCredCode':search_EQ_uniformSocialCredCode,
            'search_EQ_orgInstCode':search_EQ_orgInstCode,
            'search_EQ_archiveType':search_EQ_archiveType,
            'search_EQ_creator':search_EQ_creator,
            'search_IN_ownorg':search_IN_ownorg,
            'search_GTE_startDate_DATE':search_GTE_startDate_DATE,
            'search_LTE_expireDate_DATE':search_LTE_expireDate_DATE
        }
        req = Request(ServerUrl.ent_archivequery_getpage_url,params=params,headers=cookie)
        return req.get()

    @classmethod
    def detail(cls,id,cookie):
        '''详情跳转'''
        data = {
            'id':id
        }
        req = Request(ServerUrl.ent_archivequery_detail_url,params=data,headers=cookie)
        return req.get()

    @classmethod
    def findbyid(cls,id,cookie):
        '''详情页'''
        data = {
            'id':id
        }
        req = Request(ServerUrl.ent_archivequery_findbyid_url, params=data, headers=cookie)
        return req.get()

    @classmethod
    def getpicturefile(cls,id,cookie):
        data = {
            'id':id
        }
        req = Request(ServerUrl.ent_archivequery_getpicturefile_url,params=data,headers=cookie)
        return req.get_download()

    @classmethod
    def export(cls,
                search_EQ_enterpriseName,
                search_EQ_signCode,
                search_EQ_uniformSocialCredCode,
                search_EQ_orgInstCode,
                search_EQ_archiveType,
                search_EQ_creator,
                search_IN_ownorg,
                search_GTE_startDate_DATE,
                search_LTE_expireDate_DATE,ids,cookie):
        params = {
            'search_EQ_enterpriseName':search_EQ_enterpriseName,
            'search_EQ_signCode':search_EQ_signCode,
            'search_EQ_uniformSocialCredCode':search_EQ_uniformSocialCredCode,
            'search_EQ_orgInstCode':search_EQ_orgInstCode,
            'search_EQ_archiveType': search_EQ_archiveType,
            'search_EQ_creator': search_EQ_creator,
            'search_IN_ownorg': search_IN_ownorg,
            'search_GTE_startDate_DATE': search_GTE_startDate_DATE,
            'search_LTE_expireDate_DATE': search_LTE_expireDate_DATE,
            'ids':ids
        }
        req = Request(ServerUrl.ent_archivequery_export_url, params=params, headers=cookie)
        return req.get_download()




if __name__ == "__main__":
    pass